<template>
	<view class="center">
		<view class="logo" @click="Filder" :hover-class="!login ? 'logo-hover' : ''">
			<image class="logo-img" :src="login ? uerInfo.avatarUrl :avatarUrl"></image>
			<view class="logo-title">
				<text class="uer-name">Hi，{{user.name}}</text>
		<!-- 		<span>{{user.name}}</span> -->
				<text class="go-login navigat-arrow" v-if="!login">&#xe65e;</text>
			</view>
		</view>
		<view class="center-list">
			<view class="center-list-item border-bottom">
				<text class="list-icon">&#xe60f;</text>
				<text class="list-text" @click="zhi()">修改密码</text>
				<text class="navigat-arrow">&#xe65e;</text>
			</view>
			<view class="center-list-item">
				<text class="list-icon">&#xe639;</text>
				<text class="list-text" @click="qit()">企业信息</text>
				<text class="navigat-arrow">&#xe65e;</text>
			</view>
		</view>
		<view class="center-list">
			<view class="center-list-item border-bottom">
				<text class="list-icon">&#xe60b;</text>
				<text class="list-text" @click="shou()">我的收藏</text>
				<text class="navigat-arrow">&#xe65e;</text>
			</view>
			<view class="center-list-item">
				<text class="list-icon">&#xe65f;</text>
				<text class="list-text">服务条款及隐私</text>
				<text class="navigat-arrow">&#xe65e;</text>
			</view>
		</view>
		<view class="center-list">
			<view class="center-list-item">
				<text class="list-icon">&#xe614;</text>
				<text class="list-text">关于应用</text>
				<text class="navigat-arrow">&#xe65e;</text>
			</view>
		</view>
		
		<view class="login_from_dl">
			<button @click="logingg()">退出登录</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				eid:'',
				login: false,
				avatarUrl: "../../static/2222.jpg",
				uerInfo: {},
				user:{},
				
			}
		},
		onLoad() {
			this.a();
			this.eid=this.user.eid
			console.log(this.eid)
		},
		methods: {
			Filder(){
				if(this.eid !=='' & this.eid !=null){
					console.log("我来了")
				}else{
					uni.navigateTo({
						url:'../login/login'
					})
				}
			},
			qit(){
				uni.reLaunch({
					url:'qiye'
				})
			},
			shou(){
				uni.reLaunch({
					url:'shoucang'
				})
			},
			a(){
				console.log("欢迎光临")
				this.user=uni.getStorageSync('user')
				console.log(this.user)
			},
			// goLogin() {
			// 	if (!this.login) {
			// 		console.log("点击前往登录")
			// 	}
			// },
			logingg(){
				// uni.removeStorageSync("user")
				
				uni.removeStorage({
					key:'user',
					success:function(res) {
						// uni.reLaunch({
						// 	url:'../login/login'
						// })
						uni.navigateTo({
							url:'../login/login'
						})
					}
				})
				console.log("sssss"+this.user)
				// uni.removeStorageSync('user')
				// console.log("快来"+this.user)
			},
			zhi(){
				uni.reLaunch({
					url:'./shezhi'
				})
			}
		}
	}
</script>

<style>
	.login_from_dl {
		width: 100%;
		height: 50px;
		line-height: 50px;
		margin-top: 150upx;
	}
	
	.login_from_dl button {
		width: 100%;
		height: 50px;
		line-height: 50px;
		background: #FF3B00;
		color: #fff;
		border-radius: 50px;
	}
	@font-face {
		font-family: texticons;
		font-weight: normal;
		font-style: normal;
		src: url('https://at.alicdn.com/t/font_984210_5cs13ndgqsn.ttf') format('truetype');
	}

	page,
	view {
		display: flex;
	}

	page {
		background-color: #f8f8f8;
	}

	.center {
		flex-direction: column;
	}

	.logo {
		width: 750upx;
		height: 240upx;
		padding: 20upx;
		box-sizing: border-box;
		background-color: #4cd964;
		flex-direction: row;
		align-items: center;
	}

	.logo-hover {
		opacity: 0.8;
	}

	.logo-img {
		width: 150upx;
		height: 150upx;
		border-radius: 150upx;
	}

	.logo-title {
		height: 150upx;
		flex: 1;
		align-items: center;
		justify-content: space-between;
		flex-direction: row;
		margin-left: 20upx;
	}

	.uer-name {
		height: 60upx;
		line-height: 60upx;
		font-size: 38upx;
		color: #FFFFFF;
	}

	.go-login.navigat-arrow {
		font-size: 38upx;
		color: #FFFFFF;
	}

	.login-title {
		height: 150upx;
		align-items: self-start;
		justify-content: center;
		flex-direction: column;
		margin-left: 20upx;
	}

	.center-list {
		background-color: #FFFFFF;
		margin-top: 20upx;
		width: 750upx;
		flex-direction: column;
	}

	.center-list-item {
		height: 90upx;
		width: 750upx;
		box-sizing: border-box;
		flex-direction: row;
		padding: 0upx 20upx;
	}

	.border-bottom {
		border-bottom-width: 1upx;
		border-color: #c8c7cc;
		border-bottom-style: solid;
	}

	.list-icon {
		width: 40upx;
		height: 90upx;
		line-height: 90upx;
		font-size: 34upx;
		color: #4cd964;
		text-align: center;
		font-family: texticons;
		margin-right: 20upx;
	}

	.list-text {
		height: 90upx;
		line-height: 90upx;
		font-size: 34upx;
		color: #555;
		flex: 1;
		text-align: left;
	}

	.navigat-arrow {
		height: 90upx;
		width: 40upx;
		line-height: 90upx;
		font-size: 34upx;
		color: #555;
		text-align: right;
		font-family: texticons;
	}
</style>